# Maintainer: Alexey Pavlov <alexpux@gmail.com>
# Maintainer: Ray Donnelly <mingw.android@gmail.com>
# Contributor: Saul Ibarra Corretge <saghul@gmail.com>
# Contributor: Frode Solheim <frode@fs-uae.net>

# TODO :: subprocess.Popen .. specifically list2cmdline in subprocess.py
#         needs a fix so it can handle running MSYS2 executables better.
#         Arguments should not be quoted in the Windows fashion as-per:
#         http://www.daviddeley.com/autohotkey/parameters/parameters.htm
#         but instead how Cygwin expects them to be quoted. Checking for
#         {cygwin,msys-2.0}.dll in the executable is the only way that I
#         can think to do this at present.
#         Any double quoted string will cause problems, e.g.
#         -DGNOMELOCALEDIR=\"/mingw64/share/locale\"

_realname=python3
pkgbase="mingw-w64-${_realname}"
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
_pybasever=3.6
pkgver=${_pybasever}.5
pkgrel=1
pkgdesc="A high-level scripting language (mingw-w64)"
arch=('any')
license=('PSF')
url="https://www.python.org/"
depends=("${MINGW_PACKAGE_PREFIX}-gcc-libs"
         "${MINGW_PACKAGE_PREFIX}-expat"
         "${MINGW_PACKAGE_PREFIX}-bzip2"
         "${MINGW_PACKAGE_PREFIX}-libffi"
         "${MINGW_PACKAGE_PREFIX}-ncurses"
         "${MINGW_PACKAGE_PREFIX}-openssl"
         "${MINGW_PACKAGE_PREFIX}-readline"
         "${MINGW_PACKAGE_PREFIX}-tcl"
         "${MINGW_PACKAGE_PREFIX}-tk"
         "${MINGW_PACKAGE_PREFIX}-zlib"
         "${MINGW_PACKAGE_PREFIX}-xz"
         "${MINGW_PACKAGE_PREFIX}-sqlite3"
        )
makedepends=("${MINGW_PACKAGE_PREFIX}-gcc" "${MINGW_PACKAGE_PREFIX}-pkg-config")
options=('!makeflags') # '!strip' 'debug')
source=("https://www.python.org/ftp/python/${pkgver%rc?}/Python-${pkgver}.tar.xz"
        0000-make-_sysconfigdata.py-relocatable.patch
        0001-fix-_nt_quote_args-using-subprocess-list2cmdline.patch
        0100-MINGW-BASE-use-NT-thread-model.patch
        0110-MINGW-translate-gcc-internal-defines-to-python-platf.patch
        0130-MINGW-configure-MACHDEP-and-platform-for-build.patch
        0140-MINGW-preset-configure-defaults.patch
        0150-MINGW-configure-largefile-support-for-windows-builds.patch
        0170-MINGW-add-srcdir-PC-to-CPPFLAGS.patch
        0180-MINGW-init-system-calls.patch
        0200-MINGW-build-in-windows-modules-winreg.patch
        0210-MINGW-determine-if-pwdmodule-should-be-used.patch
        0220-MINGW-default-sys.path-calculations-for-windows-plat.patch
        0230-MINGW-AC_LIBOBJ-replacement-of-fileblocks.patch
        0240-MINGW-use-main-to-start-execution.patch
        0250-MINGW-compiler-customize-mingw-cygwin-compilers.patch
        0260-MINGW-compiler-enable-new-dtags.patch
        0270-CYGWIN-issue13756-Python-make-fail-on-cygwin.patch
        0290-issue6672-v2-Add-Mingw-recognition-to-pyport.h-to-al.patch
        0300-MINGW-configure-for-shared-build.patch
        0310-MINGW-dynamic-loading-support.patch
        0320-MINGW-implement-exec-prefix.patch
        0330-MINGW-ignore-main-program-for-frozen-scripts.patch
        0340-MINGW-setup-exclude-termios-module.patch
        0350-MINGW-setup-_multiprocessing-module.patch
        0360-MINGW-setup-select-module.patch
        0370-MINGW-setup-_ctypes-module-with-system-libffi.patch
        0380-MINGW-defect-winsock2-and-setup-_socket-module.patch
        0390-MINGW-exclude-unix-only-modules.patch
        0400-MINGW-setup-msvcrt-and-_winapi-modules.patch
        0410-MINGW-build-extensions-with-GCC.patch
        0420-MINGW-use-Mingw32CCompiler-as-default-compiler-for-m.patch
        0430-MINGW-find-import-library.patch
        0440-MINGW-setup-_ssl-module.patch
        0460-MINGW-generalization-of-posix-build-in-sysconfig.py.patch
        0462-MINGW-support-stdcall-without-underscore.patch
        0464-use-replace-instead-rename-to-avoid-failure-on-windo.patch
        0470-MINGW-avoid-circular-dependency-from-time-module-dur.patch
        0480-MINGW-generalization-of-posix-build-in-distutils-sys.patch
        0490-MINGW-customize-site.patch
        0500-add-python-config-sh.patch
        0510-cross-darwin-feature.patch
        0520-py3k-mingw-ntthreads-vs-pthreads.patch
        0530-mingw-system-libffi.patch
        0540-mingw-semicolon-DELIM.patch
        0555-msys-mingw-prefer-unix-sep-if-MSYSTEM.patch
        0560-mingw-use-posix-getpath.patch
        0565-mingw-add-ModuleFileName-dir-to-PATH.patch
        0570-mingw-add-BUILDIN_WIN32_MODULEs-time-msvcrt.patch
        0610-msys-cygwin-semi-native-build-sysconfig.patch
        0620-mingw-sysconfig-like-posix.patch
        0630-mingw-_winapi_as_builtin_for_Popen_in_cygwinccompiler.patch
        0640-mingw-x86_64-size_t-format-specifier-pid_t.patch
        0650-cross-dont-add-multiarch-paths-if-cross-compiling.patch
        0660-mingw-use-backslashes-in-compileall-py.patch
        0670-msys-convert_path-fix-and-root-hack.patch
        0690-allow-static-tcltk.patch
        0710-CROSS-properly-detect-WINDOW-_flags-for-different-nc.patch
        0720-mingw-pdcurses_ISPAD.patch
        0730-mingw-fix-ncurses-module.patch
        0740-grammar-fixes.patch
        0750-builddir-fixes.patch
        0760-msys-monkeypatch-os-system-via-sh-exe.patch
        0770-msys-replace-slashes-used-in-io-redirection.patch
        0790-mingw-add-_exec_prefix-for-tcltk-dlls.patch
        0800-mingw-install-layout-as-posix.patch
        0810-remove_path_max.default.patch
        0820-dont-link-with-gettext.patch
        0830-ctypes-python-dll.patch
        0840-gdbm-module-includes.patch
        0850-use-gnu_printf-in-format.patch
        0860-fix-_Py_CheckPython3-prototype.patch
        0870-mingw-fix-ssl-dont-use-enum_certificates.patch
        0890-mingw-build-optimized-ext.patch
        0900-cygwinccompiler-dont-strip-modules-if-pydebug.patch
        0910-fix-using-dllhandle-and-winver-mingw.patch
        0920-mingw-add-LIBPL-to-library-dirs.patch
        0930-mingw-w64-build-overlapped-module.patch
        0940-mingw-w64-Also-define-_Py_BEGIN_END_SUPPRESS_IPH-when-Py_BUILD_CORE_MODULE.patch
        0950-mingw-w64-XP3-compat-GetProcAddress-GetTickCount64.patch
        0960-mingw-w64-XP3-compat-GetProcAddress-GetFinalPathNameByHandleW.patch
        0970-Add-AMD64-to-sys-config-so-msvccompiler-get_build_version-works.patch
        0980-mingw-readline-features-skip.patch
        0990-MINGW-link-with-additional-library.patch
        1010-install-msilib.patch
        1500-mingw-w64-dont-look-in-DLLs-folder-for-python-dll.patch
        1600-fix-disable-blake2-sse.patch
        1610-fix-have-wspawnv.patch
        1620-fix-signal-module-build.patch
        1630-build-winconsoleio.patch
        1640-dont-include-consoleapi-h.patch
        1650-expose-sem_unlink.patch
        1690-need-win7-headers.patch
        1700-cygpty-isatty-disable-readline.patch
        1701-disable-broken-gdbm-module.patch
        1800-link-win-resource-files-and-build-pythonw.patch
        smoketests.py)

# Helper macros to help make tasks easier #
apply_patch_with_msg() {
  for _patch in "$@"
  do
    msg2 "Applying ${_patch}"
    patch -Nbp1 -i "${srcdir}/${_patch}"
  done
}

del_file_exists() {
  for _fname in "$@"
  do
    if [ -f ${_fname} ]; then
      rm -rf ${_fname}
    fi
  done
}
# =========================================== #

prepare() {
  cd "${srcdir}/Python-${pkgver}"

  # these are created by patches
  rm -f Misc/config_mingw \
        Misc/cross_mingw32 \
        Python/fileblocks.c

  plain "Apply Ray Donnelly's should-be-upstreamed patches"
  apply_patch_with_msg \
    0000-make-_sysconfigdata.py-relocatable.patch \
    0001-fix-_nt_quote_args-using-subprocess-list2cmdline.patch

  plain "Apply Roumen Petrov's core patches (14)"
  apply_patch_with_msg \
    0100-MINGW-BASE-use-NT-thread-model.patch \
    0110-MINGW-translate-gcc-internal-defines-to-python-platf.patch \
    0130-MINGW-configure-MACHDEP-and-platform-for-build.patch \
    0140-MINGW-preset-configure-defaults.patch \
    0150-MINGW-configure-largefile-support-for-windows-builds.patch \
    0170-MINGW-add-srcdir-PC-to-CPPFLAGS.patch \
    0180-MINGW-init-system-calls.patch \
    0200-MINGW-build-in-windows-modules-winreg.patch \
    0210-MINGW-determine-if-pwdmodule-should-be-used.patch \
    0220-MINGW-default-sys.path-calculations-for-windows-plat.patch \
    0230-MINGW-AC_LIBOBJ-replacement-of-fileblocks.patch \
    0240-MINGW-use-main-to-start-execution.patch

  plain "Apply Roumen Petrov's compiler patch (2)"
  apply_patch_with_msg \
    0250-MINGW-compiler-customize-mingw-cygwin-compilers.patch \
    0260-MINGW-compiler-enable-new-dtags.patch

  plain "Apply Roumen Petrov's extensions patches (23)"
  apply_patch_with_msg \
    0270-CYGWIN-issue13756-Python-make-fail-on-cygwin.patch \
    0290-issue6672-v2-Add-Mingw-recognition-to-pyport.h-to-al.patch \
    0300-MINGW-configure-for-shared-build.patch \
    0310-MINGW-dynamic-loading-support.patch \
    0320-MINGW-implement-exec-prefix.patch \
    0330-MINGW-ignore-main-program-for-frozen-scripts.patch \
    0340-MINGW-setup-exclude-termios-module.patch \
    0350-MINGW-setup-_multiprocessing-module.patch \
    0360-MINGW-setup-select-module.patch \
    0370-MINGW-setup-_ctypes-module-with-system-libffi.patch \
    0380-MINGW-defect-winsock2-and-setup-_socket-module.patch \
    0390-MINGW-exclude-unix-only-modules.patch \
    0400-MINGW-setup-msvcrt-and-_winapi-modules.patch \
    0410-MINGW-build-extensions-with-GCC.patch \
    0420-MINGW-use-Mingw32CCompiler-as-default-compiler-for-m.patch \
    0430-MINGW-find-import-library.patch \
    0440-MINGW-setup-_ssl-module.patch \
    0460-MINGW-generalization-of-posix-build-in-sysconfig.py.patch \
    0462-MINGW-support-stdcall-without-underscore.patch \
    0464-use-replace-instead-rename-to-avoid-failure-on-windo.patch \
    0470-MINGW-avoid-circular-dependency-from-time-module-dur.patch \
    0480-MINGW-generalization-of-posix-build-in-distutils-sys.patch \
    0490-MINGW-customize-site.patch

  plain "Apply Ray Donnelly's general/cross patches (42)"
  apply_patch_with_msg \
    0500-add-python-config-sh.patch \
    0510-cross-darwin-feature.patch \
    0520-py3k-mingw-ntthreads-vs-pthreads.patch \
    0530-mingw-system-libffi.patch \
    0540-mingw-semicolon-DELIM.patch \
    0555-msys-mingw-prefer-unix-sep-if-MSYSTEM.patch \
    0560-mingw-use-posix-getpath.patch \
    0565-mingw-add-ModuleFileName-dir-to-PATH.patch \
    0570-mingw-add-BUILDIN_WIN32_MODULEs-time-msvcrt.patch
  # 0610- changed to not using -DVPATH='"$(VPATH_b2h)"' anymore since VPATH is
  # relative, therefore getpath.c:355: joinpath(prefix, vpath) works naturally
  apply_patch_with_msg \
    0610-msys-cygwin-semi-native-build-sysconfig.patch \
    0620-mingw-sysconfig-like-posix.patch \
    0630-mingw-_winapi_as_builtin_for_Popen_in_cygwinccompiler.patch \
    0640-mingw-x86_64-size_t-format-specifier-pid_t.patch \
    0650-cross-dont-add-multiarch-paths-if-cross-compiling.patch \
    0660-mingw-use-backslashes-in-compileall-py.patch \
    0670-msys-convert_path-fix-and-root-hack.patch
    0690-allow-static-tcltk.patch
  #patch -Np1 -i "${srcdir}"/0710-CROSS-properly-detect-WINDOW-_flags-for-different-nc.patch
  apply_patch_with_msg \
    0720-mingw-pdcurses_ISPAD.patch \
    0730-mingw-fix-ncurses-module.patch \
    0740-grammar-fixes.patch \
    0750-builddir-fixes.patch \
    0760-msys-monkeypatch-os-system-via-sh-exe.patch \
    0770-msys-replace-slashes-used-in-io-redirection.patch \
    0790-mingw-add-_exec_prefix-for-tcltk-dlls.patch \
    0800-mingw-install-layout-as-posix.patch \
    0810-remove_path_max.default.patch \
    0820-dont-link-with-gettext.patch \
    0830-ctypes-python-dll.patch \
    0840-gdbm-module-includes.patch \
    0850-use-gnu_printf-in-format.patch \
    0860-fix-_Py_CheckPython3-prototype.patch \
    0870-mingw-fix-ssl-dont-use-enum_certificates.patch \
    0890-mingw-build-optimized-ext.patch \
    0900-cygwinccompiler-dont-strip-modules-if-pydebug.patch \
    0910-fix-using-dllhandle-and-winver-mingw.patch \
    0920-mingw-add-LIBPL-to-library-dirs.patch \
    0930-mingw-w64-build-overlapped-module.patch \
    0940-mingw-w64-Also-define-_Py_BEGIN_END_SUPPRESS_IPH-when-Py_BUILD_CORE_MODULE.patch \
    0950-mingw-w64-XP3-compat-GetProcAddress-GetTickCount64.patch \
    0960-mingw-w64-XP3-compat-GetProcAddress-GetFinalPathNameByHandleW.patch \
    0970-Add-AMD64-to-sys-config-so-msvccompiler-get_build_version-works.patch
    0980-mingw-readline-features-skip.patch
    0990-MINGW-link-with-additional-library.patch
    1010-install-msilib.patch

  plain "Apply patch contributed by Frode Solheim from FS-UAE project (1)"
  apply_patch_with_msg \
    1500-mingw-w64-dont-look-in-DLLs-folder-for-python-dll.patch

  plain "New patches added for the update from 3.5.3 to 3.6.1"
  apply_patch_with_msg \
    1600-fix-disable-blake2-sse.patch \
    1610-fix-have-wspawnv.patch \
    1620-fix-signal-module-build.patch \
    1630-build-winconsoleio.patch \
    1640-dont-include-consoleapi-h.patch \
    1650-expose-sem_unlink.patch

  # 3.6.3 needs some win 7 headers at build time for optional win 7 features
  apply_patch_with_msg \
    1690-need-win7-headers.patch

  # Extend some isatty calls to check for mintty when checking for
  # a terminal output. Disable the readline module under non-mintty as it
  # breaks things with a real console (like conemu or winpty)
  # https://github.com/Alexpux/MINGW-packages/issues/2645
  # https://github.com/Alexpux/MINGW-packages/issues/2656
  apply_patch_with_msg \
    1700-cygpty-isatty-disable-readline.patch

  # gdbm is broken and as a result breaks dbm/shelve.
  # Don't include it so the dbm.dumb backend is used instead,
  # like with the official CPython build.
  apply_patch_with_msg \
    1701-disable-broken-gdbm-module.patch

  # https://github.com/Alexpux/MINGW-packages/issues/3139
  apply_patch_with_msg \
    1800-link-win-resource-files-and-build-pythonw.patch

  autoreconf -vfi

  # Temporary workaround for FS#22322
  # See https://bugs.python.org/issue10835 for upstream report
  #sed -i "/progname =/s/python/python${_pybasever}/" Python/pythonrun.c

  touch Include/graminit.h
  touch Python/graminit.c
  touch Parser/Python.asdl
  touch Parser/asdl.py
  touch Parser/asdl_c.py
  touch Include/Python-ast.h
  touch Python/Python-ast.c
  echo \"\" > Parser/pgen.stamp

  # Ensure that we are using the system copy of various libraries (expat, zlib and libffi),
  # rather than copies shipped in the tarball
  rm -r Modules/expat
  rm -r Modules/zlib
  rm -r Modules/_ctypes/{darwin,libffi}*
}

check() {
  cd "${srcdir}/build-${CARCH}"

  # Some basic tests to ensure nothing major or MSYS2 specific features are
  # broken
  ./python.exe "${srcdir}/smoketests.py"
  MSYSTEM= ./python.exe "${srcdir}/smoketests.py"

  # make test EXTRATESTOPTS="-v"
}

build() {
  local PREFIX_WIN=$(cygpath -wm ${MINGW_PREFIX})

  CFLAGS+=" -fwrapv -D__USE_MINGW_ANSI_STDIO=1 "
  CXXFLAGS+=" -fwrapv -D__USE_MINGW_ANSI_STDIO=1"
  CPPFLAGS+=" -I${PREFIX_WIN}/include/ncursesw "

  declare -a _extra_config
  if check_option "strip" "y"; then
    LDFLAGS+=" -s "
  fi
  if check_option "debug" "n"; then
    CFLAGS+=" -DNDEBUG "
    CXXFLAGS+=" -DNDEBUG "
  else
    plain " -DDEBUG -DPy_DEBUG -D_DEBUG does not work unfortunately .."
    #    CFLAGS+=" -DDEBUG -DPy_DEBUG -D_DEBUG "
    #    CXXFLAGS+=" -DDEBUG -DPy_DEBUG -D_DEBUG "
    CFLAGS+=" -O0 -ggdb"
    CXXFLAGS+=" -O0 -ggdb"
    _extra_config+=("--with-pydebug")
  fi

  # Workaround for conftest error on 64-bit builds
  export ac_cv_working_tzset=no

  [ -d "${srcdir}/build-${CARCH}" ] && rm -rf "${srcdir}/build-${CARCH}"
  mkdir -p "${srcdir}/build-${CARCH}" && cd "${srcdir}/build-${CARCH}"

  MSYSTEM=MINGW ../Python-${pkgver}/configure \
    --prefix=${MINGW_PREFIX} \
    --host=${MINGW_CHOST} \
    --build=${MINGW_CHOST} \
    --enable-shared \
    --with-threads \
    --with-system-expat \
    --with-system-ffi \
    --without-ensurepip \
    "${_extra_config[@]}" \
    OPT=""

  make
}

package() {
  cd "${srcdir}/build-${CARCH}"

  local PREFIX_WIN=$(cygpath -wm ${MINGW_PREFIX})
  MSYSTEM=MINGW \
  MSYS2_ARG_CONV_EXCL="--prefix=;--install-scripts=;--install-platlib=" \
  make install DESTDIR="$pkgdir"
  if check_option "debug" "n"; then
    VERABI=${_pybasever}m
  else
    VERABI=${_pybasever}dm
  fi

  # gdb pretty printers for debugging Python itself; to use:
  # python
  # sys.path.append('C:/msys64/mingw64/share/gdb/python3')
  # import python_gdb
  # reload(python_gdb)
  # end
  [[ -d "${pkgdir}${MINGW_PREFIX}"/share/gdb/python3/ ]] || mkdir -p "${pkgdir}${MINGW_PREFIX}"/share/gdb/python3/
  cp -f python.exe-gdb.py "${pkgdir}${MINGW_PREFIX}"/share/gdb/python3/python_gdb.py

  rm "${pkgdir}${MINGW_PREFIX}"/bin/2to3
  cp -f "${pkgdir}${MINGW_PREFIX}"/lib/python${_pybasever}/config-${VERABI}/libpython${VERABI}.dll.a "${pkgdir}${MINGW_PREFIX}"/lib/libpython${VERABI}.dll.a

  # Need for building boost python3 module
  cp -f "${pkgdir}${MINGW_PREFIX}"/lib/python${_pybasever}/config-${VERABI}/libpython${VERABI}.dll.a "${pkgdir}${MINGW_PREFIX}"/lib/libpython${_pybasever}.dll.a
  cp -f "${pkgdir}${MINGW_PREFIX}"/lib/python${_pybasever}/config-${VERABI}/libpython${VERABI}.dll.a "${pkgdir}${MINGW_PREFIX}"/lib/python${_pybasever}/config-${VERABI}/libpython${_pybasever}.dll.a

  # some useful "stuff"
  install -dm755 "${pkgdir}${MINGW_PREFIX}"/lib/python${_pybasever}/Tools/{i18n,scripts}
  install -m755 "${srcdir}/Python-${pkgver}"/Tools/i18n/{msgfmt,pygettext}.py "${pkgdir}${MINGW_PREFIX}"/lib/python${_pybasever}/Tools/i18n/
  install -m755 "${srcdir}/Python-${pkgver}"/Tools/scripts/{README,*py} "${pkgdir}${MINGW_PREFIX}"/lib/python${_pybasever}/Tools/scripts/

  # clean up #!s
  find "${pkgdir}${MINGW_PREFIX}"/lib/python${_pybasever}/ -name '*.py' | \
    xargs sed -i "s|#[ ]*![ ]*/usr/bin/env python$|#!/usr/bin/env python3|"

  # clean-up reference to build directory
  sed -i "s#${srcdir}/Python-${pkgver}:##" "${pkgdir}${MINGW_PREFIX}"/lib/python${_pybasever}/config-${VERABI}/Makefile

  for fscripts in 2to3-${_pybasever} idle3 idle${_pybasever} pydoc3 pydoc${_pybasever} pyvenv pyvenv-${_pybasever}; do
    sed -e "s|${MINGW_PREFIX}/bin/python${_pybasever}.exe|/usr/bin/env python${_pybasever}.exe|g" -i "${pkgdir}${MINGW_PREFIX}"/bin/$fscripts
  done

  sed -i "s|#!${pkgdir}${MINGW_PREFIX}/bin/python${VERABI}.exe|#!/usr/bin/env python${_pybasever}.exe|" "${pkgdir}${MINGW_PREFIX}"/lib/python${_pybasever}/config-${VERABI}/python-config.py

  # fix permissons
  find ${pkgdir}${MINGW_PREFIX} -type f \( -name "*.dll" -o -name "*.exe" \) | xargs chmod 0755

  # Fix up two instances of MSYS2 paths in python-config.sh in-case the final consumer of the results are native executables.
  sed -e "s|${MINGW_PREFIX}|${PREFIX_WIN}|" \
    -i "${pkgdir}${MINGW_PREFIX}"/bin/python${VERABI}-config \
    -i "${pkgdir}${MINGW_PREFIX}"/bin/python${_pybasever}-config \
    -i "${pkgdir}${MINGW_PREFIX}"/bin/python3-config

  # replace paths in sysconfig
  sed -i "s|${pkgdir}${MINGW_PREFIX}|${MINGW_PREFIX}|g" \
    "${pkgdir}${MINGW_PREFIX}"/lib/python${_pybasever}/lib-dynload/_sysconfigdata*.py \
    "${pkgdir}${MINGW_PREFIX}"/lib/python${_pybasever}/smtpd.py
}

sha256sums=('f434053ba1b5c8a5cc597e966ead3c5143012af827fd3f0697d21450bb8d87a6'
            '15fcd682901a7d3b76c5616e991dcb1616a823117f0cd3169e8df34c09e2d108'
            '00ee34263e56d073dd4bed327dab7f28d35a175ba552be54bd31fcfe2a507543'
            '9d6feeb319d5d82304b4b467579024f54c58f837148ae768ebe76cf5423c3ea3'
            '08c538159182534cf4cb46e5a6dfd4ae7c0939a53d7e750e1f4c002f29580615'
            '250363160794111313d07cf49b9f461f081ba621e2de44bedba452959b714fe9'
            '9aade12717e34bf77a6e29a501e71acea1a9a067c103f843931be265d55ba5c3'
            'e9b0589928548c98630609ce2351dcb32dfa1a92dc77e207c487c453c34cf6c1'
            '014558f3083505477ab8a106d0aac96706dad7fde24cab46cbc849aba82f1762'
            '56a4dd7f627635b811517b08004f1afc1549abeb18f45c63b1c8d8dc3e2c89b1'
            '3ef304b736b0a59d8561fb1fb1aacadd7e7b82c43213a311f1121d8326c6211a'
            'ad194d563368031e170abd225ddf834744215a7db6b51b2fda19e062638f268c'
            'c0584864511f6a608ef5e613b338b17284c7d9aa811063e76b029664286552d4'
            '9d9257718a48a6db6e779b8ed08efd69873e1ec11a0317116f5919ef6b501f26'
            '6d147fad9fafb89e91a6effbb3ddff5e9d804a5a56500d88b83169d389c783f6'
            '2da98aea69050989d6d35b8c583346ace6ed357a4ef20bb313d4fad871750f2c'
            '217d61d33b3b6af2bdc40bcda3d0e1cf0b35f5fc05cbd36629253f6d00018d9d'
            '9095f717510892b76c2f10d51a12096f03c9138aada04c357564cd0ffc8d5b34'
            '0cab47fda75024ae1131db771fb78df519e7dd10f63c6e3726bab6008822416a'
            '8f147960d444564c9e63b2cff57a721908a75b4f297425412c3030be695bdd62'
            'f052e0a960e90246062a647ea3f857be3bc6aeffe5b958406a475064c3fb10b1'
            '32ddf02e4be9335445553f92f0d27476ce4ae05989fb6fe37b82b92a2e2c7c2b'
            '232a644cecd75323510ee68507f96a35bd2f5c02f08adf21cb5260b67f7e8e73'
            '48bd1f91fcce6da60edaafae626e997387f48155a1ae1a5837890c56437cf404'
            '842ec633a6c0cfe7b2f77820a98885e47d53596abb543d27e5988d6bcd77b3e4'
            '91473e14b85a9bed9eff21840ef28e71324efad06c25889f39d55bb9ef134173'
            '2fb436ebebfea9ec68ec69fee1d0c42ea862da7282394a6c7ca3474567795c35'
            '55d5a1ab8ee338141d867278ec62bb254310910531fe33a90b49815de8afee26'
            '8e21169ca12c081f9f1ce54b187f73a26d2924029b9fa125b7858128c9da8ec0'
            '476c1066580562e67eb45ddb250339ce58312704bc6532c69d1fb87934b94962'
            'ae94a39e99a17c510dde9f9953df89e2614fae97458afde8b44171ef68c17e15'
            'd4eba2c4d78dd58dfb2d2da1e3b2a22c104e5fa3d78784916b1593e80780bb67'
            'e4208040eaaee7eedee7d39bc5587608b5313bba3e21030bc27b7568c15fab53'
            '2f184f7fb699ac239c4ab83143b197d3be601751f411d87b0928f5ab49e1aef5'
            '644d7bf31f74fb9a0ff0ab4b61608e1c98a9781e8ec05d1faee56d4a3bc1fef1'
            '070ae4b558731c5831e1d6d512d57068cfb9ca370955456db91c225a1dc3e814'
            '7433a7485360b96730b1425f65a58aeae04f680737912e20b214409040d455af'
            'c6fa00f86388f84b72d11dfc2d32a2bee1bc19160ac13e5285f214f27baa05cc'
            '7acbddc62c73209c30086e6b65e1c5b5ee2bc16ef20a3a8d6e7b87d739435de5'
            '506a1b31a79c8748390df807c5a6cf24b9b9be70e7d19e778207df425e636691'
            '6bb2ca71df938342c06c3ffce2201049c2367143e8368074faba046756028b42'
            '72cdcfd5dccff194bd86cc89f20d3298860664ed562b1a952cc6336013de912b'
            '42a861d7389d2f8a29b66d5a620a0810f019aaed1fb103020df35087d0a3d83b'
            'cbcb68e25c93ed670fe03a1bbe9cf4eda08f39b4a1356dfd8d797b65335c4964'
            '46c43cd2d0d87fd28b21e373413dabff6081272ed73d754f145ac2948bd943e6'
            'b520a0acd1efe3a6484f0ac840f295807505fea2ac910a97f40d703ec8c935e4'
            '721a1cadd9d9df1e1a674e13a2e047247e31b0541784e39436e214c7de194997'
            '3e1d588bc9afa6c94e30793b005f574cf0626eaef9e863e57afbcd70abdf011e'
            '52bcc4897c24e3e952a39d40f1a4d2d14c6fe5c76dc8217b6ba986b098426ec3'
            '961a89adec4b0d0cd98d03f06fdc6aefade097e5d395ecfac6623f271ced02c3'
            'c82f17e93c38bdac64d5aeb5dd849c881ec8b8965e0908e2e139b1e98b11fcfb'
            '666c8dd8a4018f9aef40f704fdfc9c9867ac6e13c92a4492202897d05aa589ce'
            'a5539ec33f326ad01f25ef3ccb7580d0e61fcbac7caf58ea26d1a6c4148c369e'
            '1155cde9c3b3f3745d39757e47600a78645979a1fdbbdbb6ecc6a6a3f2c264df'
            '899920d9aa168a8223a420fb56b52c16600c85ee1618b381f486720eb46b8e84'
            '9e66c59887c4a634b34672962ad8187a3f6fdf310719ac8e91fbdf55b40db9d1'
            'b119a2158d6d02732e1902d16f19c2e9c319389972ae8ffb22f6dd80b9efd62d'
            'f643831842e9c2c15f1ecb3ec96022f6f32af2a88e0e4501e56b20d86905995d'
            '95f96d5dc0fe3e7e4bac947f39a950e4b85d48d0c868cb552be2e39d7dd0fdb2'
            '71c2d070f3f434a0e54b723268a73fdbf81a7abe24b55f292a37a26cc46bdef8'
            '107460105cdb3f1d34e5add1282fd527c340f0e9df7373b3d3dd70f1733774e4'
            'f66d893d370e36f04657e03fb3aadcae6861bf7848b7e6fe86b4fa26456847e9'
            '2634032f94a13891389d9ca3462d35fb70d658aae03e0f95ea454e7d9d210b4f'
            'd172428e0d4356c50cb663f77ddb95e73b04704e2d4fcc7ad9e1f82c01a8c313'
            '7fe090490f2b5771c78bf633f15a5e7f897d0c3fff9a0d4b551f148de7102035'
            '623296db23b953f4778ade05652c935dff5e4b30dc46cf07fbcc147c3615ed7c'
            '58423347b070338e944518a5679b106148ed3802953beab526b6492a94342522'
            '69a46dae793fd60335746a26bfc51105ff4295d0812417fd73e958bafbb2acf8'
            '3a46d9d83837d0ab49db7cc2229faee8ae75af68ec1062f55c21b0c16da47131'
            '0db36c70c817ae8a6479502247e2fd50af5cbfdfb8f72225ce31ab63d48b5b55'
            '405c1392ddc5623c314d38bc2eead1fccb33e9c4abf757b221d596cfb8610d0f'
            '399acaccbcd428fc2728fa4fefe4609e8a4818539afd7c324f70db25273d524c'
            'abcdf15dcf814309160bdd6376139f4e0b9db88254a9fbd41b9b75ed49729716'
            '362d63fcdcd3aca22ebb5b03d927f0be0fc85cbd39e213180a88e0a61401e900'
            '5feb0769b95901d730c226c60a31687f98325fa83dd4550a9c43af0f314fea8a'
            '138110a98a56903eb3730ef3bba73c87fdf62348cb641a6f1f5b62cb8bd0d388'
            'ac27efa31feadcb05ee2e5f5350f62e2b1fed6d3933e988c1dbd83bcba7a4a6a'
            '10f7542947372442a681c6119716b42639e4fd00b80f648f2f5c4aa9508f3f8b'
            '19316b6ccf12912220311e6f9b1b2356e8a94025da91c7108afe3bba9c91cd0d'
            '057cc123a859ba2a7a7c003879e87d87bdf7b8366f5403ff979a1a95ac78b305'
            'a3cd9131e2ae447ae0fd0b6edc54c500753a496ab2ab349a447127e8e42ca2dc'
            '79a41fe36f515a67aefb518e4717e17914e98ade1fbc5176a8688de84e96aebf'
            '6b1d03e9912ccc05275e60e2130ebc3a60ef054f08f5619ffec4637de27ed072'
            '8f3c3a4e266321286b744b9c803c08108da282d9e5719dc270aaa86930c91889'
            'cf094a0e160c327bd54aa3d58712e8cf01b0ae142b5a697cd5b0c106c5e58581'
            'bb4a837e9241f7e4b3fe63b364496675cf1f7c06c4c2907440bce9d300848718'
            'f1b6425c636f0ba1a7796d2b8acda6c87f23bf4bcec505b9062ad0a239b43b03'
            'a11dc4586e9533030f0e8f4c9ca745e5f95a0ba3d38754f564627b0f757e4a98'
            '82b8df512a5ab5b00dc5d3b4c8407d74137f369eede8cffdcbff61ea62fb51c0'
            'b84a5449b066c32672455d80b82382789b118014b1e341bbb9b6e9230b8d5979'
            '2eddc5b8aa6be2d07f8721c172b6c584cec2c0f78615ffdcd3f18178a299ea18'
            '85dd94a7fd1361c982802f0a1ce30115c96dc829c600a39ccccd1889e8a0e259'
            '38e4812481335e1a3ce2cb2c843ead94267fc0ecb7f7797408d4b36d9de3d1d9'
            'd4b0316fc3b73b3c6ee545f27a64fb21baee315732aacddde08529c530c0516d'
            '35f4dfc8362356a2f51bae3fc0ae5802a278302ea89a36828769d48b12ed195b'
            '0c345b144f36b92b216d6d277875326faf2e4187ac62101d3bd9aba9ed053998'
            'f4f5359b35741b703cbd22dc73438c181b8541e30b3f7614bd272f7cd2c59049')
